import { defineStore } from "pinia";
import { store } from "../index";

interface AppState {
  // 用户信息
  isCollapse: boolean;
  version: string;
}

export const useAppStore = defineStore("app", {
  state: (): AppState => ({
    isCollapse: false,
    version: "0.0.1",
  }),
  actions: {
    changeIsCollapse() {
      this.isCollapse = !this.isCollapse;
    },
  },
  persist: true,
});

export const useAppStoreWithOut = () => {
  return useAppStore(store);
};
